package objectsDiagram;

import java.awt.Color;
import java.awt.Point;
import java.util.LinkedList;

public class Flow {
	private Color color;
	private boolean inTrace;
	private State source;
	private State target;
	
	private LinkedList<Point> coordenates;
	//predicate

	public Flow() {
		color = Color.BLACK;
		inTrace = false;
		coordenates = new LinkedList<Point> ();
	}

	public Color getColor() {
		return color;
	}

	public void setColor(Color color) {
		this.color = color;
	}

	public boolean isInTrace() {
		return inTrace;
	}

	public void setInTrace(boolean inTrace) {
		this.inTrace = inTrace;
	}

	public State getSource() {
		return source;
	}

	public void setSource(State newSource) {
		source = newSource;
	}

	public State getTarget() {
		return target;
	}

	public void setTarget(State target) {
		this.target = target;
	}

	public LinkedList<Point> getCoordenates() {
		return coordenates;
	}

	public void setCoordenates(Point coordenates){
		this.coordenates.add(coordenates);
	}
	
	public Flow clone(){
		Flow newFlow = new Flow();
		newFlow.setSource(source);
		newFlow.setTarget(target);
		for(int i=0;i<coordenates.size();i++){
			Point newPoint = new Point(coordenates.get(i).x,coordenates.get(i).y);
			
			newFlow.setCoordenates(newPoint);
		}
		return newFlow;
		
	}
}
